package cn.kgc83.shengyin.controller;

import cn.kgc83.shengyin.domain.Article;
import cn.kgc83.shengyin.service.IArticleService;
import cn.kgc83.shengyin.vo.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
@RestController//为前端访问准备
@RequestMapping("front/course")
public class ArtilceFrontController extends BaseController{

    public static final String COURSE="COURSE";
    @Autowired
    private IArticleService articleService;

    @GetMapping("/list")
    public Page searchByType(){
        Article art=new Article();
        art.setTypecode(COURSE);//?
        art.setIsvalid(true);
        List<Article> articles = articleService.selectArticleList(art);
        return getDataTable(articles);
    }
}
